

package com.cn.项目.飞机预约管理系统.UserFrame;

import com.cn.项目.飞机预约管理系统.chat.ChatClient;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


public class UserMainFrame extends JFrame {
    public UserMainFrame() {

        initComponents();
    }

    //出行帮助
    private void button1ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new TravelHelp();

    }

    //查看公告
    private void button2ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new DisplayReport();
    }

    //机票查询
    private void button3ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new SelectStartEnd();
    }

    //我的订单
    private void button4ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new MyolderJframe();
    }

    //

    //添加乘客
    private void button5ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new AddPassenger();
    }

    //我的乘客
    private void button6ActionPerformed(ActionEvent e) {
        // TODO add your code here
         new MyPessenger();


    }

    //机票预定
    private void button8ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new BookTickets();
    }

    //沟通
    private void button9ActionPerformed(ActionEvent e) {
        // TODO add your code here
        JFrame app = new JFrame("客户端");
        app.getContentPane().add(new ChatClient());
        app.setSize(400,300 );
        app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        app.setVisible(true);
    }


    //个人信息
    private void button7ActionPerformed(ActionEvent e) {
        // TODO add your code here
        new PersonalInformation();
    }




    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        label1 = new JLabel();
        button1 = new JButton();
        button2 = new JButton();
        button3 = new JButton();
        button4 = new JButton();
        button5 = new JButton();
        button6 = new JButton();
        button7 = new JButton();
        button8 = new JButton();
        button9 = new JButton();

        //======== this ========
        setVisible(true);
        setFont(new Font("Dialog", Font.PLAIN, 15));
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label1 ----
        label1.setText("飞机预约管理系统");
        label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 12f));
        label1.setForeground(new Color(0, 204, 153));
        contentPane.add(label1);
        label1.setBounds(80, 15, 285, 45);

        //---- button1 ----
        button1.setText("出行帮助");
        button1.setFont(button1.getFont().deriveFont(button1.getFont().getSize() + 5f));
        button1.addActionListener(e -> button1ActionPerformed(e));
        contentPane.add(button1);
        button1.setBounds(25, 85, 125, 40);

        //---- button2 ----
        button2.setText("查看公告");
        button2.setFont(button2.getFont().deriveFont(button2.getFont().getSize() + 5f));
        button2.addActionListener(e -> button2ActionPerformed(e));
        contentPane.add(button2);
        button2.setBounds(215, 85, 125, 40);

        //---- button3 ----
        button3.setText("机票查询");
        button3.setFont(button3.getFont().deriveFont(button3.getFont().getSize() + 5f));
        button3.addActionListener(e -> button3ActionPerformed(e));
        contentPane.add(button3);
        button3.setBounds(25, 160, 125, 40);

        //---- button4 ----
        button4.setText("我的订单");
        button4.setFont(button4.getFont().deriveFont(button4.getFont().getSize() + 5f));
        button4.addActionListener(e -> button4ActionPerformed(e));
        contentPane.add(button4);
        button4.setBounds(215, 160, 125, 40);

        //---- button5 ----
        button5.setText("添加乘客");
        button5.setFont(button5.getFont().deriveFont(button5.getFont().getSize() + 5f));
        button5.addActionListener(e -> button5ActionPerformed(e));
        contentPane.add(button5);
        button5.setBounds(25, 235, 125, 40);

        //---- button6 ----
        button6.setText("我的乘客");
        button6.setFont(button6.getFont().deriveFont(button6.getFont().getSize() + 5f));
        button6.addActionListener(e -> button6ActionPerformed(e));
        contentPane.add(button6);
        button6.setBounds(215, 235, 125, 40);

        //---- button7 ----
        button7.setText("个人信息");
        button7.setFont(button7.getFont().deriveFont(button7.getFont().getSize() + 5f));
        button7.addActionListener(e -> button7ActionPerformed(e));
        contentPane.add(button7);
        button7.setBounds(120, 365, 125, 40);

        //---- button8 ----
        button8.setText("机票预订");
        button8.setFont(button8.getFont().deriveFont(button8.getFont().getSize() + 5f));
        button8.addActionListener(e -> {
			button8ActionPerformed(e);
			button8ActionPerformed(e);
		});
        contentPane.add(button8);
        button8.setBounds(25, 305, 125, 40);

        //---- button9 ----
        button9.setText("沟通");
        button9.setFont(button9.getFont().deriveFont(button9.getFont().getSize() + 5f));
        button9.addActionListener(e -> button9ActionPerformed(e));
        contentPane.add(button9);
        button9.setBounds(215, 305, 125, 40);

        contentPane.setPreferredSize(new Dimension(395, 450));
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JLabel label1;
    private JButton button1;
    private JButton button2;
    private JButton button3;
    private JButton button4;
    private JButton button5;
    private JButton button6;
    private JButton button7;
    private JButton button8;
    private JButton button9;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
